package com.canton.service.impl;


import com.canton.dao.utils.DefaultOntModel;
import com.canton.service.*;
import org.apache.jena.ontology.*;
import org.apache.jena.rdf.model.StmtIterator;
import org.apache.jena.util.iterator.ExtendedIterator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

/**
 * @Auther ChenX
 * @Date 2020.10.19
 **/
@Service
public class CountServiceImpl implements CountService {


    @Autowired
    private GrapeService grapeService;
    @Autowired
    private ImageService imageService;
    @Autowired
    private ClipService clipService;
    @Autowired
    private AreaService areaService;
    @Autowired
    private ClimateService climateService;
    @Autowired
    private DiseaseService diseaseService;
    @Autowired
    private PestService pestService;
    @Autowired
    private ClassService classService;
    @Autowired
    private DrugService drugService;
    @Autowired
    private CultivationService cultivationService;
    @Autowired
    private MethodService methodService;
    @Autowired
    private SymptomService symptomService;
    @Async("countExecutor")
    public CompletableFuture<Integer> countGrape() {
        return CompletableFuture.completedFuture(grapeService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countImage() {
        return CompletableFuture.completedFuture(imageService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countClip() {
        return CompletableFuture.completedFuture(clipService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countArea() {
        return CompletableFuture.completedFuture(areaService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countClimate() {
        return CompletableFuture.completedFuture(climateService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countDisease() {
        return CompletableFuture.completedFuture(diseaseService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countPest() {
        return CompletableFuture.completedFuture(pestService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countClass() {
        return CompletableFuture.completedFuture(classService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countDrug() {
        return CompletableFuture.completedFuture(drugService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countCultivation() {
        return CompletableFuture.completedFuture(cultivationService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countMethod() {
        return CompletableFuture.completedFuture(methodService.findAll().size());
    }

    @Async("countExecutor")
    public CompletableFuture<Integer> countSymptom() {
        return CompletableFuture.completedFuture(symptomService.findAll().size());
    }

//    @Async("countExecutor")
//    public CompletableFuture<Integer> countTuple() {
//        return CompletableFuture.completedFuture();
//    }
}
